package com.itheima.manager;

import com.itheima.common.R;
import com.itheima.domain.Subject;
import com.itheima.service.ISubjectService;
import com.itheima.vo.PageBeanVo;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class CmsSubjectManager {


    @DubboReference
    ISubjectService subjectService;


    public R getByNameAndPage(Integer pageNum, Integer pageSize, String keyword) {

        PageBeanVo byNameAndPage = subjectService.findByNameAndPage(pageNum, pageSize, keyword);
        return R.success(byNameAndPage);

    }

    public R getAll() {
        List<Subject> all =subjectService.getAll();
        return R.success(all);
    }
}
